//
//  IMManager.m
//  MLIM
//
//  Created by molon on 15/7/9.
//  Copyright (c) 2015年 molon. All rights reserved.
//

#import "IMManager.h"
#import "IMCommon.h"

NSString * const MLIM_IMManagerStatus_Updated_Notification = @"com.molon.MLIM_IMManagerStatus_Updated_Notification";

@interface IMManager()

@property (nonatomic, assign) IMManagerStatus status;

@end

@implementation IMManager

+ (instancetype)manager
{
    static id _sharedInstance = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _sharedInstance = [[[self class] alloc]init];
    });
    return _sharedInstance;
}

//使用clietnId连接服务器
- (void)loginWithClientId:(NSString*)clientId callback:(IMBooleanResultBlock)callback
{
    [self doesNotRecognizeSelector:_cmd];
}

//主动关闭连接
- (void)logoutWithCallback:(IMBooleanResultBlock)callback
{
    [self doesNotRecognizeSelector:_cmd];
}

#pragma mark - setter
- (void)setStatus:(IMManagerStatus)status
{
    _status = status;

    DLOG(@"status->%ld",status);
    
    [[NSNotificationCenter defaultCenter]postNotificationName:MLIM_IMManagerStatus_Updated_Notification object:nil userInfo:@{@"status":@(status)}];
}

@end
